package com.huilian.iotbox.mqtt.server.base.service.impl;

import com.huilian.iotbox.data.dto.OrderItemDto;
import com.huilian.iotbox.data.po.OrderItem;
import com.huilian.iotbox.data.vo.OrderItemVo;
import com.huilian.iotbox.mqtt.server.base.dao.OrderItemDao;
import com.huilian.iotbox.mqtt.server.base.service.OrderItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderItemServiceImpl implements OrderItemService {

    @Autowired
    private OrderItemDao orderItemDao;

    @Override
    public int add(OrderItem orderItem) {
        return orderItemDao.insert(orderItem);
    }

    @Override
    public List<OrderItemVo> findOrderItemList(String payNo,String deviceNo) {
        return orderItemDao.findOrderItemList(payNo,deviceNo);
    }

    @Override
    public Integer update(OrderItemVo orderItemVo) {
        return orderItemDao.update(orderItemVo);
    }

    @Override
    public List<OrderItem> findOrderItemListByOrderId(Long orderId) {
        return orderItemDao.findOrderItemListByOrderId(orderId);
    }

    @Override
    public OrderItemVo findOrderItem(String payNo, String deviceNo) {
        return orderItemDao.findOrderItem(payNo,deviceNo);
    }

    @Override
    public OrderItemVo findOrderItemCountByOrderId(Long orderId, Long orderItemId) {
        return orderItemDao.findOrderItemCountByOrderId(orderId,orderItemId);
    }

    @Override
    public OrderItemVo findSumShipment(Long orderId) {
        return orderItemDao.findSumShipment(orderId);
    }

    @Override
    public List<OrderItemVo> findAllByOrderId(Long orderId, Long displayRackId) {
        return orderItemDao.findAllByOrderId(orderId,displayRackId);
    }

    @Override
    public OrderItemVo getOrderItem(OrderItemDto orderItemDto) {
        return orderItemDao.getOrderItem(orderItemDto);
    }

    @Override
    public List<OrderItem> findOrderItemListByPayNo(String payNo, String deviceNo) {
        return orderItemDao.findOrderItemListByPayNo(payNo,deviceNo);
    }
}
